// Copyright (c) 2023, json_wang and contributors
// For license information, please see license.txt

frappe.ui.form.on('wxwork_token', {
	refresh: function (frm) {
		frm.add_custom_button('刷新TOKEN', () => {
			frm.call('refresh_token', { throw_if_missing: true })
				.then(r => {
					console.log(r)
					frm.refresh()
				})
		}),
		frm.add_custom_button('同步用户', () => {
			frm.call('sync_users', { throw_if_missing: true })
				.then(r => {
					console.log(r)
					frm.refresh()
				})
		})
	},
});
